<?php
namespace Home\Controller;
class ArticleController extends CommonController{
    public function _initialize(){
        parent::_initialize();
        $this->obj = M('one');
        $this->cateObj = M('OneCate');
    }

	public function index(){
        $id=I('get.id',1,'intval');
        if(!$id) $this->redirect('Index/index');
        $info = getPages($id);
        //if(!$info) $this->redirect('Index/index');
        //读取所有分类
        $map['status'] = 1;
        $map['pid'] = 0;
        $this->catelists = $this->cateObj->where($map)->order('ordid asc,id desc')->select();
        $this->info = $info;
        $this->cateid = $id;
        $this->seoKey($info);
        $this->display();
	}
}
